﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Controllers.Extend;
using Controllers.Filter;

namespace Controllers.Areas.UserInfo.Controllers
{
    public class IndexController : UserBaseController
    {
        protected override void OnAuthorization(AuthorizationContext filterContext)
        {
            cookieName = "UserInfo";
            base.OnAuthorization(filterContext);

            if (loginUser == null)
            {
                if (filterContext.RequestContext.HttpContext.Request.IsAjaxRequest())
                {
                    filterContext.Result = new ContentResult() { Content = "<a href=\"/AdminLogin/Index\">请登录</a>" };
                }
                else
                {
                    filterContext.Result = new RedirectResult("/Home/Index");
                }
            }
        }

        public ActionResult Index()
        {
            return View();
        }
    }
}
